[AGENT-12513] Fix Ansible check mode when installer/apm injection is enabled #619
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
not ansible_check_mode
condition to the parentwhen
. We should not run any of the commands/file fromdd-host-install
in check mode which we were doing individually (except injecting the Docker config which we should not have done in check mode, so this "fixes" it incidentally)datadog_installer_install_result
which itself is only registered when not running in check mode, as coded in eachtasks/pkg-
, e.g.:ansible-datadog/tasks/pkg-debian/install-installer.yml
Line 8 in a34e962
not ansible_check_mode
on all the subsequent steps that depend on this registry, as we should not run any bootstrap/installer command, nor attempt to send any telemetry in check mode--check
yet)Motivation
Closes #610
QA instructions
Use a playbook with the installer:
Role
Collection
Run it in check mode and ensure it does not error out:
ansible-playbook -i inventory.ini playbook.yml --check